<%@page import="test.vtableVo"%>
<%@page import="test.vtableDTO"%>
<%@page import="bean.ScoreVo"%>
<%@page import="bean.ScoreDTO"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel ='stylesheet' href ="./one/score.css"/>
<script src="./one/score.js"></script>
</head>
<body>
<!-- 기억하게 하기 위해 type = 'hidden' 눈에 안보임-->

<jsp:useBean id="vo" class ="test.vtableVo" scope = "page"/>
<jsp:setProperty property="*" name="vo"/>

<%

vtableDTO dto = new vtableDTO();
dto.setVo(vo);
ArrayList<vtableVo> al = dto.select();

%>
<script>alert(<%=al.size()%>);</script>
<form name = 'hiddenFrm' method='post'>
	<input type = 'hidden' name = 'nowPage' value = '<%=vo.getNowPage()%>'>
	<input type = 'hidden' name = 'find' value = '<%=vo.getFind()%>'>
	<input type = 'hidden' name = 'rno' value = '<%=vo.getRno()%>'>
</form>


<h1>List</h1>
<div id="vtable_list_find" style="width: 578px;" align="right">
		<form action = 'index.jsp?inc=./one/list.jsp' name="vtable_list_frm" method="post">
		<input type = 'text' name ="find" value = <%=vo.getFind()%>>
		<input type = 'submit' value ="검색">
	</form>
</div>
<div id = 'vtable_list_title'>
	<div class = 'vtable_list_rno'>순번</div>
	<div class = 'vtable_list_mid'>아이디</div>

</div>
<%for(int a = 0;a<al.size();a++){ 
vtableVo v = al.get(a);%>
<div class = 'vtable_list_tiems'>
	<div class = 'vtable_list_rno'><%=v.getRno()%></div>
	<div class = 'vtable_list_mid'>
		<a href = '#' onclick = 'goView(<%=dto.getNowPage()%>,<%=v.getRno()%>)'>
		<%=v.getMid() %>
		</a></div>



</div>
<%}int i=0; %>

<div id = 'list_page'>
<a href ='#'onclick ='goPage(1)'>처음</a>

<%if(dto.getNowPage() !=1){%>
<a href ='#'onclick='goPage(<%=dto.getNowPage()-1%>)'>이전 페이지</a>
<%}%>

<%
for( i = dto.getStartPage(); i <= dto.getEndPage(); i++){
if(dto.getNowPage() ==i){
%>
<b><a href ='#'onclick='goPage(<%=i%>)'><%=i%></a></b>
<%}else{ %>
<a href ='#'onclick='goPage(<%=i%>)'><%=i%></a>
<%}
}%>

<%if(dto.getNowPage() !=dto.getTotPage()){%>
<a href ='#'onclick='goPage(<%=dto.getNowPage()+1%>)'>다음 페이지</a>
<%}%>

<%if(dto.getTotPage() != dto.getNowPage()){ %>
<a href ='#'onclick='goPage(<%=i%>)'>다음</a>
<%}%>

<a href ='#'onclick='goPage(<%=dto.getTotPage()%>)'>마지막</a>



</div>
<input type = 'button' value ='학생 정보  작성' id='btnInput'/> <br>


<script>listInit();</script>

</body>
</html>